<!--
 * @FileDescription 基础信息
 * @Author 杨宇翔
 * @Date 20220706 10:26:35
 * @LastEditors 杨宇翔
 * @LastEditTime 20220706 10:26:35
-->
<template>
    <div class="basic-information">
        <table>
            <tbody>
                <tr v-for="row of rows" :key="row">
                    <template v-for="config of configs.slice(column * row, column * (row + 1))" :key="config.Id">
                        <td>
                            <span>{{ config.Name }}</span>
                        </td>
                        <td>
                            <span>{{ config.Value }}{{ config.Unit }}</span>
                        </td>
                    </template>
                </tr>
            </tbody>
        </table>

        <div class="container">
            <UseRollAngle />
            <UseYawAngle />
            <UsePitchAngle />
        </div>
    </div>
</template>

<script setup lang="ts">
import UseRollAngle from './UseRollAngle.vue';
import UseYawAngle from './UseYawAngle.vue';
import UsePitchAngle from './UsePitchAngle.vue';
import { ProtocolComponent } from './InertialNavigationComponent';
import { computed } from 'vue';

const rows = [0, 1, 2, 3, 4, 5, 6];
const column = 3;
const configs = computed(() => ProtocolComponent.Default.UseConfigs.slice(0, 21));
</script>

<style scoped>
.basic-information {
    grid-area: basic;

    padding-top: 6.2rem;

    background-color: #0d0d14;

    display: flex;
    flex-direction: column;
}

.container {
    flex-grow: 1;

    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}

table {
    width: 100%;

    border-collapse: separate;
    border-spacing: 2.5rem;
}

td>span {
    color: #81859C;
    font-size: 1.8rem;

    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

td:nth-of-type(2n)>span {
    display: inline-block;

    width: 15rem;
    height: 3.6rem;
    color: #B1B1D4;
    font-size: 1.8rem;
    line-height: 3.6rem;
    text-align: center;

    border: solid 0.1rem #36384B;

    opacity: 0.5;
}

td:nth-of-type(2n)>span:hover {
    border: solid 0.1rem;
    border-image: linear-gradient(90deg, rgba(128, 125, 225, 1), rgba(33, 140, 222, 1)) 1 1;

    opacity: 1;
}
</style>